<ui:composition template="../templates/mainTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:lalib="http://java.sun.com/jsf/composite/value"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="content">
		<h:form id="myForm">
			<h:panelGrid columns="2" styleClass="alignPanel">
				<p:panel header="#{messages['orderReport.date']}">
					<h:panelGrid columns="2">
						<h:outputText value="#{messages['foodDefination.since']} :" />
						<p:calendar value="#{cOrderReportForm.startDate}" />

						<h:outputText value="#{messages['foodDefination.till']} :" />
						<p:calendar value="#{cOrderReportForm.endDate}" />

						<h:outputText />
						<p:commandButton value="#{messages['orderReport.show']}" action="#{cOrderReportAction.generateTable()}"
							update=":myForm" />
					</h:panelGrid>
				</p:panel>
				<p:panel header="#{messages['orderReport.kaydet']}">
					<h:commandLink>
						<p:graphicImage value="/images/excel.png" />
						<p:dataExporter type="xls" target="tbl" fileName="orders" />
					</h:commandLink>
					<h:commandLink>
						<p:graphicImage value="/images/pdf.png" />
						<p:dataExporter type="pdf" target="tbl" fileName="orders" />
					</h:commandLink>
					<h:commandLink>
						<p:graphicImage value="/images/xml.png" />
						<p:dataExporter type="xml" target="tbl" fileName="orders" />
					</h:commandLink>
				</p:panel>
			</h:panelGrid>
			<p:panel>
				<f:facet name="header">
					<h:outputText value="#{messages['orderReport.title']}" />
				</f:facet>
				<h:panelGrid columns="1">
					<p:dataTable value="#{cOrderReportForm.orderBeans}" var="order" paginator="true" rows="10" id="tbl">
						<p:column>
							<f:facet name="header">
								<h:outputText value="Id" />
							</f:facet>
							<h:outputText value="#{order.order.id}" />
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{messages['orderReport.food']}" />
							</f:facet>
							<h:outputText value="#{order.order.eFood.name}" />
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{messages['orderReport.waiter']}" />
							</f:facet>
							<h:outputText value="#{order.order.eUser.name}" />
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{messages['orderReport.date']}" />
							</f:facet>
							<h:outputText value="#{order.order.date}" />
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{messages['orderReport.price']}" />
							</f:facet>
							<h:outputText value="#{order.price}" />
						</p:column>
					</p:dataTable>
				</h:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>